//
//  JYComposeTextView.swift
//  WeiBoDemo
//
//  Created by 万佳阳 on 16/8/5.
//  Copyright © 2016年 JYWan. All rights reserved.
//

import UIKit

class JYComposeTextView: UITextView {
    // MARK:- 懒加载属性
    lazy var placeholderLabel : UILabel = UILabel()
    
    // MARK:- 构造函数
    required init?(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)
        
        setupPlaceholderLabel()
    }

}

// MARK:- 设置UI界面
extension JYComposeTextView {
    private func setupPlaceholderLabel() {
        addSubview(placeholderLabel)
        
        placeholderLabel.snp_makeConstraints { (make) in
            make.top.equalTo(self).offset(8)
            make.leading.equalTo(self).offset(10)
        }
        
        placeholderLabel.text = "分享新鲜事..."
        placeholderLabel.font = font
        placeholderLabel.textColor = UIColor.lightGrayColor()
        
        textContainerInset = UIEdgeInsets(top: 7, left:6, bottom: 7, right: 6)
    }
}
